package com.zhong.gang.pda.ui.mine;

import android.view.View;

import androidx.annotation.NonNull;

import com.zhong.gang.applib.base.act.ActBase;
import com.zhong.gang.pda.R;
import com.zhong.gang.pda.databinding.ActivityMineBinding;
import com.zhong.gang.pda.db.user.UserUtils;
import com.zhong.gang.pda.ui.changepass.ChangePassAct;

public class MineAct extends ActBase<ActivityMineBinding> {
    private MinePresenter presenter;

    @Override
    public int LayoutRes() {
        return R.layout.activity_mine;
    }

    @NonNull
    @Override
    public String CreateTitle() {
        return "我的";
    }

    @Override
    public void initView() {
        bind.setAct(this);
        presenter = new MinePresenter();
        bind.accountName.setText(UserUtils.getIntent(this).getUser().getPhone()+"");
        bind.name.setText(UserUtils.getIntent(this).getUser().getName());
        bind.number.setText(UserUtils.getIntent(this).getUser().getIdCard());
    }

    public void onViewClicked(View view) {
        switch (view.getId()){
            case R.id.change_pass:
                openActivity(ChangePassAct.class);
                break;
            case R.id.login_out:
                presenter.loginOut(this);
                break;
        }
    }
}
